package com.example.mooctao.util;

import androidx.lifecycle.SavedStateHandle;
import androidx.lifecycle.ViewModel;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
//存储和管理MeFragment的数据
public class MeViewModel extends ViewModel {
    private final SavedStateHandle savedStateHandle;

    public MeViewModel(SavedStateHandle savedStateHandle) {
        this.savedStateHandle = savedStateHandle;
    }
    public void setData(List<Map<String, Object>> data) {
        savedStateHandle.set("data", data);
    }

    public List<Map<String, Object>> getData() {
        return savedStateHandle.get("data");
    }
}